home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / errortbl / readme.txt < prev   
Encoding:
Text File  |  1995-12-22  |  7.9 KB  |  178 lines

  1.  
  2. TErrorTable component for Borland Delphi
  3.  
  4. Are you frustrated with not being able to get more specific information when
  5. encountering BDE errors in Delphi, especially with Paradox tables and validity
  6. checks ?  Wouldn't it be nice if a min/max check fails and you could find out
  7. what field is having the problem ?  Wouldn't it be nice if you could have a
  8. central application exception handler and still be able to deal with (using
  9. plain, non-cryptic messages) table-specific errors, such as key violations ?
  10.  
  11. Freeware, including source, from OnTYme Software.
  12.  
  13. TErrorTable is a descendant from TTable that allows you to attach specific
  14. event handlers to the component for BDE errors such as key violations, min/
  15. max checks, required checks (see below), etc.  The component also logs the
  16. specific error contexts regarding the error when it occurs in properties in
  17. the component.  This allows you to react to specific events for specific
  18. tables and retrieve the necessary information to build a nice, non-frightening
  19. message to display to the users.  Unfortunately, the built-in exception
  20. messages in the BDE are far from understandable to an end user and are next
  21. to impossible to parse in message format to derive the information needed
  22. by you, the programmer, as to what exactly went wrong.  This is especially
  23. true when dealing with highly-marketed end-user oriented programs using
  24. local databases such as Paradox or DBase.  To take full advantage of the
  25. component, especially with Paradox files, turn off all of the built-in Delphi
  26. validity checks for the TFields by making the Required property false and
  27. the Min/Max properties 0.  This will allow the TErrorTable to let the Paradox
  28. validity checks take effect directly from the tables and will permit the
  29. TErrorTable component to generate all exception events properly for you.
  30.  
  31. Currently, the errors that are trapped are as follows:
  32.  
  33. Key violations
  34. Minimum validity checks
  35. Maximum validity checks
  36. Required checks
  37. Master record missing (with referential integrity)
  38. Lookup table fail
  39. Record lock fail
  40. Record unlock fail
  41. File is locked by another user
  42. Directory is locked by another user
  43. Other errors (none of the above)
  44.  
  45. ******************************************************************************
  46. One note, the required checks will not execute if you do not have a TField
  47. object defined for a field and do not turn off (set to False) the Required
  48. property.  The error will be trapped as a EDatabaseError exception, so to get
  49. the most mileage out of the TErrorTable component you should always define
  50. TField objects and set their Required properties to False.  This will let
  51. Paradox and the TErrorTable component handle all exceptions.
  52. ******************************************************************************
  53.  
  54. All events pass the exception on to the event handler, so you are always able
  55. to just display the original exception message if you wish.  Please note,
  56. currently if you DO NOT attach an event handler the exception will be 
  57. essentially passed on to the main application exception handler, or if none
  58. is present, on to the the Delphi default exception handling.
  59.  
  60. The event handlers are as follows:
  61.  
  62. OnKeyViolation
  63. OnMinCheckFail
  64. OnMaxCheckFail
  65. OnFldRequired
  66. OnMasterMissing
  67. OnLookupTblFail
  68. OnRecLockFail
  69. OnRecUnLockFail
  70. OnFileIsLocked
  71. OnDirIsLocked
  72. OnOtherErrors
  73.  
  74. New events in this version:
  75.  
  76. OnMultipleNetFiles    -    Triggered when there are multiple .NET files or .LCK
  77.                                 files in use, usually caused by an abnormal termination
  78.                                 of the current program in previous session.
  79.  
  80. The error context properties are as follows:
  81.  
  82. ErrorToken
  83. ErrorTableName
  84. ErrorFieldName
  85. ErrorImageRow
  86. ErrorUserName
  87. ErrorFileName
  88. ErrorIndexName
  89. ErrorDirName
  90. ErrorKeyName
  91. ErrorAlias
  92. ErrorDriveName
  93. ErrorNativeCode
  94. ErrorNativeMsg
  95. ErrorLineNumber
  96. ErrorCapability
  97.  
  98.  
  99. New properties in this version:
  100.  
  101. ErrorFieldDispName    -    Contains the "nice" field name from the DisplayLabel
  102.                                 property of the TField component for which the error
  103.                                 is associated.
  104.  
  105. ErrorFieldMinValue    -    Contains the minimum value (as a string) directly
  106.                                 from the Paradox files for use in formatting an
  107.                                 error message that contains what the minimum value
  108.                                 should be for an entry.
  109.  
  110. ErrorFieldMaxValue    -    Contains the maximum value (as a string) directly
  111.                                 from the Paradox files for use in formatting an
  112.                                 error message that contains what the maximum value
  113.                                 should be for an entry.
  114.  
  115. ******************************************************************************
  116. Please note, all of these properties are read-only.  Also, don't get upset
  117. if you can't retrieve any context information such as ErrorKeyName when a
  118. key violation error occurs, for some reason the BDE doesn't log any info on
  119. this error when it occurs.  Sorry !
  120. ******************************************************************************
  121.  
  122. As an example, suppose you attempt to place a TTable in edit mode and the
  123. record you are attempting to edit is locked by another user.  In this case,
  124. the OnRecLockFail event will be triggered and the ErrorTableName property will
  125. contain the table name and the ErrorUserName will contain the name of the
  126. user who currently has the record locked.
  127.  
  128. Well that's about it, if you have any questions or comments please let me
  129. know at CServe ID 73302,2561 or you can give me a buzz at 407-246-0930.
  130. Also, if you make any improvements to the component please send me a copy
  131. so that I can implement in any future versions.  Currently, I plan on
  132. adding security error trapping (Paradox tables only) as well as some goodies
  133. for filters and packing.  What I'd like to see is a combination of all of 
  134. the extended TTable components on the Delphi forum so that there is one 
  135. component that contains all of these great features.  I'm also investigating
  136. the feasability of rollback and recovery for Paradox and DBase tables, so let
  137. me know if you have any insight into this one.
  138.  
  139. About me
  140.  
  141. I specialize in manufacturing applications, specifically make-to-order, and
  142. am looking also to build some high level components for configurations and
  143. bills of material.  I come from a FoxPro/Clipper background and am always 
  144. happy to swap stories about the differences, likes/dislikes, regarding the 
  145. two environments.  I personally don't like coding in FoxPro or Clipper too 
  146. much anymore if you know what I mean.  By the way, if you're located in 
  147. Orlando FL. and are interested, I'm looking to form a Delphi study/user group
  148. to promote discussion regarding problems and solutions with Delphi in the 
  149. local community.  Give me a call and we'll talk some more.  My office is in 
  150. my home, but it's fairly large so I could probably fit about 10-12 people 
  151. tops.  I'm located in College Park in Orlando, in case you're wondering......
  152.  
  153. Tim Young
  154. OnTYme Software
  155.  
  156. Bug Fix and Enhancement History
  157.  
  158. 8/24/95    -    Original TErrorTable
  159. 9/7/95    -    Fixed    problem with the BeforeEdit, BeforePost, etc. events
  160.                 getting turned off by the TErrorTable.  Added properties for
  161.                 ErrorFieldDispName for the "nice" field name from the DisplayLabel
  162.                 property of the TFields and ErrorFieldMinValue and 
  163.                 ErrorFieldMaxValue properties for retrieving the min/max string
  164.                 values when a min/max error occurs. Added event for "Multiple
  165.                 .NET files in use" exception (very common).
  166. 9/12/95    -    Fixed problem with error properties getting cleared due to an
  167.                 internal ordering problem with my BDE calls.  Also cleaned up
  168.                 the code a bit.
  169.  
  170. ******************************************************************************
  171. I make no warranties regarding the use of this component and will not be held
  172. responsible for any damages incurred from the use of this component.  I will
  173. try to fix any bugs found in a reasonably timely manner, but in the case of
  174. this not happening you have the source so fix it yourself.
  175. ******************************************************************************
  176.  
  177. (C) Copyright 1995 OnTYme Software
  178.